<extend name="Layout/application"/>

<block name="css">
   <style>
      /*.am-form-file {*/
         /*position: relative;*/
         /*overflow: hidden*/
      /*}*/

      /*.am-form-file input[type=file] {*/
         /*position: absolute;*/
         /*left: 0;*/
         /*top: 0;*/
         /*z-index: 1;*/
         /*width: 100%;*/
         /*opacity: 0;*/
         /*cursor: pointer;*/
         /*font-size: 50rem*/
      /*}*/
   </style>
</block>
<block name="content">
   <section class="content-header">
      <h1>
         新增文章
         <small>Article create</small>
      </h1>
      <ol class="breadcrumb">
         <li><a href="#"><i class="fa fa-dashboard"></i> Article</a></li>
         <li class="active">Create</li>
      </ol>
   </section>

   <section class="content" style="width: 70%;">
      <div class="box box-success">

         <div class="box-body">
            <form role="form" method="post" action="{{:url('articles/save')}}">
               <div class="box-body">
                  <div class="form-group">
                     <label>文章分类</label>
                     <select class="form-control" name="category_id">
                        <option>请选择分类</option>
                        <volist name="categories" id="category">
                           <option value="{{$category.id}}">{{$category.name}}</option>
                           <volist name="category.children" id="children">
                              <option value="{{$children.id}}">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;+++{{$children.name}}
                              </option>
                           </volist>

                        </volist>
                     </select>
                  </div>
                  <div class="form-group">
                     <label>文章标题</label>
                     <input type="text" name="title" class="form-control" placeholder="请输入文章标题">
                  </div>
                  <div class="form-group">
                     <label>关键字</label>
                     <input type="text" name="keyword" class="form-control" placeholder="请输入关键字">
                  </div>
                  <div class="form-group">
                     <label>描述</label>
                     <textarea name="description" id="" cols="60" rows="5" class="form-control"
                               placeholder="请输入描述"></textarea>
                  </div>
                  <div class="form-group">
                     <label>缩略图</label>
                     <div class="form-group am-form-file">
                        <!--使用上面样式-->
                        <!--<button class="btn btn-warning"><i class="fa fa-upload" id="loading"></i>上传的缩略图</button>-->
                        <!--<input type="file" id="image_upload">-->
                        <!--不使用样式-->
                        <button class="btn btn-warning upload_img"><i class="fa fa-upload" id="loading"></i>上传缩略图</button>
                        <input type="file" id="image_upload" style="display: none;">
                        <input type="hidden" name="photo_id">
                     </div>
                     <div>
                        <img src="http://oze5mdef4.bkt.clouddn.com/cec3f09beaf1f2051ad51277fa2da422.png"
                             id="img_show" style="max-height: 150px;">
                     </div>
                  </div>
                  <div class="form-group">
                     <label>排序</label>
                     <input type="text" name="sort_order" class="form-control" placeholder="请输入排序，最大99">
                  </div>

                  <div class="form-group">
                     <label>是否置顶</label>
                     <div class="radio">
                        <label>
                           <input type="radio" name="is_top" class="flat-red" value="1" checked> 是
                        </label>
                        <label>
                           <input type="radio" name="is_top" class="flat-red" value="0"> 否
                        </label>
                     </div>
                  </div>
                  <div class="form-group">
                     <label>是否推荐</label>
                     <div class="radio">
                        <label>
                           <input type="radio" name="is_recommend" value="1" checked> 是
                        </label>
                        <label>
                           <input type="radio" name="is_recommend" value="0"> 否
                        </label>
                     </div>
                  </div>
                  <div class="form-group">
                     <label>文章内容</label>
                     <!-- 加载编辑器的容器 -->
                     <textarea id="container" name="content" type="text/plain"></textarea>
                  </div>


                  <div class="box-footer">
                     <button type="submit" class="btn btn-primary">提交</button>
                     <button type="reset" class="btn btn-default">重置</button>
                  </div>
               </div>
            </form>
         </div>
      </div>

   </section>
</block>

<block name="js">
   <!--上传图片-->
   <script src="/vendor/qiniu/jquery.html5-fileupload.js"></script>
   <script src="/vendor/qiniu/upload.js"></script>


   <!--ueditor编辑器-->
   <script src="/vendor/ueditor/utf8-php/ueditor.config.js"></script>
   <script src="/vendor/ueditor/utf8-php/ueditor.all.js"></script>
   <script type="text/javascript">
      $(function () {
         //实例化编辑器
         var ue = UE.getEditor('container', {
            initialFrameWidth: 1100,//设置编辑器宽度
            initialFrameHeight: 800,//设置编辑器高度
            scaleEnabled: true,
         });
      })
   </script>

</block>



